package com.washmadam.service.common.utils;

import javax.servlet.http.HttpServletResponse;

import com.excel.poi.ExcelBoot;
import com.excel.poi.common.Constant;

public class ExcelUtils extends ExcelBoot{
	/**
     * 单批分页条数
     */
    public static final int DEFAULT_PAGE_SIZE = 10000;
    /**
     * 分页sheet页数
     */
    public static final int DEFAULT_MAX_RECORD_COUNT_PEER_SHEET = 65536;
    /**
     * 是否开启自动适配宽度
     */
    public static final boolean OPEN_AUTO_COLUM_WIDTH = true;

	protected ExcelUtils(HttpServletResponse httpServletResponse, String fileName, Class excelClass) {
		 this(httpServletResponse, fileName, excelClass, ExcelUtils.DEFAULT_PAGE_SIZE,ExcelUtils.DEFAULT_MAX_RECORD_COUNT_PEER_SHEET);
	}
	protected ExcelUtils(HttpServletResponse httpServletResponse, String fileName, Class excelClass,Integer pageSize,Integer peerSheetSize) {
		this(httpServletResponse, fileName, excelClass, pageSize,peerSheetSize,ExcelUtils.OPEN_AUTO_COLUM_WIDTH);
	}

	protected ExcelUtils(HttpServletResponse httpServletResponse, String fileName, Class excelClass,Integer pageSize,Integer peerSheetSize,Boolean openAutoColumWidth) {
		super(httpServletResponse, null, null, fileName, excelClass, pageSize, Constant.DEFAULT_ROW_ACCESS_WINDOW_SIZE, peerSheetSize, openAutoColumWidth);
	}
	/**
	 * 
	* @Title: ExportBuilder 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param @param httpServletResponse
	* @param @param fileName 导出excel文件名称
	* @param @param clazz excel导出映射实体类
	* @param @return    设定文件 
	* @return ExcelUtils    返回类型 
	* @throws 
	* @author lixin
	* @date Nov 5, 2019 10:12:26 AM
	 */
	public static ExcelUtils ExportBuilder(HttpServletResponse httpServletResponse, String fileName, Class clazz) {
        return new ExcelUtils(httpServletResponse, fileName, clazz);
    }

}
